#include<bits/stdc++.h>
using namespace std;
int n,L,R;
int main()
{
	freopen("candy.in","r",stdin);
	freopen("candy.out","w",stdout);
	cin>>n>>L>>R;
	int x=L/n*n;
	L-=x;R-=x;
	cout<<min(n-1,R);
}
